import http from '.'
/**
 *
 *查询物业人员
 */
export function queryPropertyUser(params) {
  return http.get(
    'api/v1/property/propertyUser/query?' + Form(params).queryString()
  )
}

/**
 *查询物业人员
 */
export function addPropertyUser(params) {
  return http.post(
    'api/v1/property/propertyUser/addPropertyUser?',
    Form(params)
  )
}
/*
 * 查询物业公司
 */
export function queryPropertyCompany(params) {
  return http.get(
    'api/v1/property/propertyCompany/query?' + Form(params).queryString()
  )
}
/**
 * 新增、修改物业公司
 */
export function savePropertyCompany(params) {
  return http.post(
    `api/v1/property/propertyCompany/${params.rowId ? 'edit' : 'add'}`,
    Form(params)
  )
}
/**
 * 删除物业公司
 */
export function deletePropertyCompany(rowId) {
  return http.post(
    'api/v1/property/propertyCompany/deletePropertyCompany?rowId=' + rowId
  )
}
/**
 * 查询物业小区
 */
export function querycommunity(params) {
  return http.get(
    'api/v1/property/propertyCompanyCommunityReal/query?' +
      Form(params).queryString()
  )
}
/**
 * 删除物业小区deleteUser
 */
export function deleteCommunity(rowId) {
  return http.post(
    'api/v1/property/propertyCompanyCommunityReal/delete?rowId=' + rowId
  )
}
/**
 * 查询物业人员
 */
export function selectPropertyUser(params) {
  return http.get(
    'api/v1/property/propertyCompanyUserReal/query?' +
      Form(params).queryString()
  )
}
/**
 * 删除物业人员
 */
export function deleteUser(rowId) {
  return http.post(
    'api/v1/property/propertyCompanyUserReal/delete?rowId=' + rowId
  )
}
/**
 * 查询物业公司申请
 */
export function querypropertyCompanyApply(params) {
  return http.get(
    'api/v1/property/propertyCompanyApply/queryPropertyCompanyApply?' +
      Form(params).queryString()
  )
}
/**
 * 驳回物业公司申请
 */
export function rejectPropertyUserApply(params) {
  return http.post(
    `api/v1/property/propertyCompanyApply/${params.rowId ? 'edit' : 'add'}`,
    Form(params)
  )
}
/**
 * 审核物业公司申请
 */
export function approvePropertyCompanyApply(params) {
  return http.post(
    `api/v1/property/propertyCompanyApply/aprovePropertyCompanyApply`,
    Form(params)
  )
}
/**
 *修改物业人员
 */
export function editPropertyUser(params) {
  return http.post(
    'api/v1/property/propertyUser/editPropertyUser?',
    Form(params)
  )
}
/**
 * 根据物业人员id查询该人员下的小区
 * @param {*} userId
 */
export function selectPropertyUserCommunity(userId) {
  return http.get(
    'api/v1/property/propertyUser/selectPropertyUserCommunity?userId=' + userId
  )
}

/**
 * 解除物业人员与该小区的关系
 * @param {*} rowId
 */
export function deletePropertyUserCommunity(rowId) {
  return http.post(
    'api/v1/property/propertyUserCommunityReal/delete?rowId=' + rowId
  )
}
/**
 * 删除物业人员
 * @param {*} rowId
 */
export function deletePropertyUser(rowId) {
  return http.post('api/v1/property/propertyUser/delete?rowId=' + rowId)
}
/**
 *查询物业人员申请记录
 */
export function queryPropertyUserApply(params) {
  return http.get(
    'api/v1/property/propertyUserApply/query?' + Form(params).queryString()
  )
}
/**
 * 通过物业人员申请记录
 * @param {*} params
 */
export function approvePropertyUserApply(params) {
  return http.post(
    'api/v1/property/propertyUserApply/approvePropertyUserApply?',
    Form(params)
  )
}
/**
 *驳回物业人员申请记录
 */
export function editPropertyUserApply(params) {
  return http.post(
    `api/v1/property/propertyUserApply/${params.rowId ? 'edit' : 'add'}`,
    Form(params)
  )
}

/**
 * 物业管理邀请记录
 * @param {*} params
 */
export function queryPropertyUserInvite(params) {
  return http.get(
    'api/v1/property/propertyUserInvite/query?' + Form(params).queryString()
  )
}
